import 'package:flutter_test/flutter_test.dart';
import 'package:screen_capture/screen_capture.dart';
import 'package:screen_capture/screen_capture_platform_interface.dart';
import 'package:screen_capture/screen_capture_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockScreenCapturePlatform
    with MockPlatformInterfaceMixin
    implements ScreenCapturePlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final ScreenCapturePlatform initialPlatform = ScreenCapturePlatform.instance;

  test('$MethodChannelScreenCapture is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelScreenCapture>());
  });

  test('getPlatformVersion', () async {
    ScreenCapture screenCapturePlugin = ScreenCapture();
    MockScreenCapturePlatform fakePlatform = MockScreenCapturePlatform();
    ScreenCapturePlatform.instance = fakePlatform;

    expect(await screenCapturePlugin.getPlatformVersion(), '42');
  });
}
